import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/base_unit_stop_list_entity.dart';

BaseUnitStopListEntity $BaseUnitStopListEntityFromJson(Map<String, dynamic> json) {
  final BaseUnitStopListEntity baseUnitStopListEntity = BaseUnitStopListEntity();
  final int? checkType = jsonConvert.convert<int>(json['checkType']);
  if (checkType != null) {
    baseUnitStopListEntity.checkType = checkType;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    baseUnitStopListEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    baseUnitStopListEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    baseUnitStopListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    baseUnitStopListEntity.createDate = createDate;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    baseUnitStopListEntity.deviceName = deviceName;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    baseUnitStopListEntity.fileUrl = fileUrl;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    baseUnitStopListEntity.hazardCode = hazardCode;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    baseUnitStopListEntity.id = id;
  }
  final int? inspectionStatus = jsonConvert.convert<int>(json['inspectionStatus']);
  if (inspectionStatus != null) {
    baseUnitStopListEntity.inspectionStatus = inspectionStatus;
  }
  final int? isPlan = jsonConvert.convert<int>(json['isPlan']);
  if (isPlan != null) {
    baseUnitStopListEntity.isPlan = isPlan;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    baseUnitStopListEntity.riskUnitId = riskUnitId;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    baseUnitStopListEntity.status = status;
  }
  final String? stopEndTime = jsonConvert.convert<String>(json['stopEndTime']);
  if (stopEndTime != null) {
    baseUnitStopListEntity.stopEndTime = stopEndTime;
  }
  final int? stopRange = jsonConvert.convert<int>(json['stopRange']);
  if (stopRange != null) {
    baseUnitStopListEntity.stopRange = stopRange;
  }
  final String? stopReason = jsonConvert.convert<String>(json['stopReason']);
  if (stopReason != null) {
    baseUnitStopListEntity.stopReason = stopReason;
  }
  final String? stopStartTime = jsonConvert.convert<String>(json['stopStartTime']);
  if (stopStartTime != null) {
    baseUnitStopListEntity.stopStartTime = stopStartTime;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    baseUnitStopListEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    baseUnitStopListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    baseUnitStopListEntity.updateDate = updateDate;
  }
  return baseUnitStopListEntity;
}

Map<String, dynamic> $BaseUnitStopListEntityToJson(BaseUnitStopListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['checkType'] = entity.checkType;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deviceName'] = entity.deviceName;
  data['fileUrl'] = entity.fileUrl;
  data['hazardCode'] = entity.hazardCode;
  data['id'] = entity.id;
  data['inspectionStatus'] = entity.inspectionStatus;
  data['isPlan'] = entity.isPlan;
  data['riskUnitId'] = entity.riskUnitId;
  data['status'] = entity.status;
  data['stopEndTime'] = entity.stopEndTime;
  data['stopRange'] = entity.stopRange;
  data['stopReason'] = entity.stopReason;
  data['stopStartTime'] = entity.stopStartTime;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension BaseUnitStopListEntityExtension on BaseUnitStopListEntity {
  BaseUnitStopListEntity copyWith({
    int? checkType,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deviceName,
    String? fileUrl,
    String? hazardCode,
    String? id,
    int? inspectionStatus,
    int? isPlan,
    String? riskUnitId,
    int? status,
    String? stopEndTime,
    int? stopRange,
    String? stopReason,
    String? stopStartTime,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return BaseUnitStopListEntity()
      ..checkType = checkType ?? this.checkType
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deviceName = deviceName ?? this.deviceName
      ..fileUrl = fileUrl ?? this.fileUrl
      ..hazardCode = hazardCode ?? this.hazardCode
      ..id = id ?? this.id
      ..inspectionStatus = inspectionStatus ?? this.inspectionStatus
      ..isPlan = isPlan ?? this.isPlan
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..status = status ?? this.status
      ..stopEndTime = stopEndTime ?? this.stopEndTime
      ..stopRange = stopRange ?? this.stopRange
      ..stopReason = stopReason ?? this.stopReason
      ..stopStartTime = stopStartTime ?? this.stopStartTime
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
